home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Video Toaster 4.3
/
Video Toaster v4.3.iso
/
4.2
/
arexx
/
switcher
/
toastercommandhost.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1998-04-16
|
2KB
|
63 lines
/* ToasterCommandHost.rexx -- Provide command host access to Switcher() functions */
/* By Arnie Cachelin © 1992 NewTek Inc. */
/*
This program acts as a Command Host interface for the Video Toaster Switcher
which has a 'function host' interface. The function host interface requires
that all commands be sent as arguments to the Switcher() function,
which is defined when the command "ADDLIB('ToasterARexx.port',0)" has
been executed. The more common 'command host' type of ARexx interface
sends command strings to the address specified by the ADDRESS command.
This type of interface is more compatible with direct control by
programs like AmigaVision, CanDo, and others. To start the command host
interface, first run the Toaster, then run this program. Now all
commands sent to "TOASTER_COMMAND_HOST" will be translated into the
appropriate function calls. The commands are identical to those described
in the manual. If you send the command HOST_EXIT, this program will quit.
*/
OPTIONS RESULTS
port=TOASTER_COMMAND_HOST /* This port name will receive commands for the switcher */
HOST_EXIT='HOST_EXIT' /* Send this string to shut down this program */
TOASTERLIB="ToasterARexx.port" /* Name of the Toaster function host port */
NULL_PKT = '0000 0000'x
LIBNAME = "rexxsupport.library"
IF ~SHOW('Libraries',LIBNAME) THEN
IF ~ADDLIB(LIBNAME , 0 , -30 , 0) THEN x=Bummer("Cant find "LIBNAME)
IF ~SHOW('Libraries',TOASTERLIB) THEN
IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer("Please start your Video Toaster!")
CALL OPENPORT PORT
IF ~SHOW('Ports',PORT) THEN x=Bummer("Can't open port: "port)
SAY "Toaster Command Host open for business!"
SAY "Send commands to port: "port
SAY "Send "HOST_EXIT" to shut down command host."
DO FOREVER
packet = NULL_PKT
DO WHILE packet = NULL_PKT
CALL WAITPKT(PORT)
packet = GETPKT(PORT)
END
pktstring = GETARG(packet)
CALL REPLY(packet,0) /* We don't presume to judge the packet ==>no return */
IF UPPER(pktstring) = HOST_EXIT THEN x=Bummer(" Received "HOST_EXIT" request.")
pktstring=TRANSLATE(STRIP(pktstring),","," ") /* replace space with comma */
FunctionCmd="x=Switcher("pktstring")"
SAY FunctionCmd
INTERPRET FunctionCmd
END
EXIT
Bummer: PROCEDURE
ARG etxt
IF RC~="RC" then
SAY "ERROR: "||RC||etxt
ELSE
SAY "Guess What: "etxt
EXIT
RETURN 0